import time

import requests
import os

url = "https://api.landchina.com/tGdxm/result/list"

# 请求头
headers = {
    "Host": "api.landchina.com",
    "Hash": "d400d8c5179d82e69348aeec71ef5acfc49d0e9eb7d2f7c56e75b1befa315471",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36",
    "Accept": "application/json, text/plain, */*",
    "Content-Type": "application/json",
}
for page in range(1, 151):
    data = {
        "pageNum": page,
        "pageSize": 40,
        "startDate": "",
        "endDate": ""
    }

    response = requests.post(url, headers=headers, json=data, verify=False)
    print(response.status_code)
    json_str = response.json()


    data_list = json_str["data"]["list"]
    print(data_list)
    for item in data_list:
        address = item["xzqFullName"]
        # print(address)
        area = int(item["gyMj"]) * 10
        use = item["tdYt"]
        print(address, area, use)
    time.sleep(3)
